package cn.com.jrr.core.controller.hat;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.com.jrr.core.model.hat.City;
import cn.com.jrr.core.model.hat.Province;
import cn.com.jrr.core.model.hat.School;
import cn.com.jrr.core.service.hat.HatService;

@Controller
@RequestMapping("/syshat")
public class HatAction {
    @Autowired
    private HatService hatService;

    @ResponseBody
    @RequestMapping("/listprovince")
    public List<Province> listProvince(){
        List<Province> data=hatService.provinceList();
        return data;
    }
    @ResponseBody
    @RequestMapping("/listcity")
    public List<City> listCity(@RequestParam String father){
        List<City> data=hatService.cityList(father);
        return data;
    }
    @ResponseBody
    @RequestMapping("/school")
    public List<School> listSchool(@RequestParam String place){
        List<School> data=hatService.schoolList(place);
        return data;
    }

}
